<div id="systemRegister" class="easyui-layout" data-options="fit:true">
<div data-options="region:'center'" >
    <div class="xy-toolbar" id="srTool">
        <div class="xy-toolbar-left">系统列表
            <button class="iconfont icon-xinzeng xy-button"><span>&nbsp;&nbsp;增加</span></button>
            <button class="iconfont icon-shanchu xy-button"><span>&nbsp;&nbsp;删除</span></button>
            <button class="iconfont icon-xiugai xy-button"><span>&nbsp;&nbsp;修改</span></button>
        </div>

        <div class="xy-toolbar-right">
            <input id="select" class="easyui-combobox" name="dept"
                   data-options="valueField:'id',textField:'text',url:'get_data.php'"/>
            <button class="iconfont icon-soushuo xy-button"><span>&nbsp;&nbsp;搜索</span></button>
        </div>
    </div>
    <table id="sysData"></table>
</div>
</div>
<script>
    $(function () {
        $('#sysData').datagrid({
            url: '/structure/listUserByStructure', //数据接收URL地址
            pagination : true,
            pagePosition : 'bottom',
            pageSize : 10,
            pageList : [10, 20, 50],
            fit : true,
            fitColumns : false,//在表格列多的时候设置为false
            nowrap : false,	//表格内容较多时自动换行
            border : false,
            idField : 'id',
            toolbar:"#srTool",
//            singleSelect: true,
//            checkOnSelect: true,
//            selectOnCheck: true,
            columns: [[
                {field:"ck",checkbox:"true"},
                { field: 'username', title: '姓名',editor:'text', width: '20%', sortable: true },
                { field: 'sex', title: '日期', width: '20%', sortable: true },
                { field: 'sign', title: '时间', width: '20%', sortable: true },
                { field: 'experience', title: '有效否', width: '16%', sortable: true },
                { field: 'score', title: '备注', width: '20%' }
            ]],
            onLoadSuccess:function () {
//                active['checkboxChange'].call(this,$(this));

            }
        });
        //触发事件
        var active = {
            add: function () {
                var that = this;
//多窗口模式，层叠置顶
                layer.open({
                    type: 2 //此处以iframe举例
                    , title: '当你选择该窗体时，即会在最顶端'
                    , area: ['800px', '800px']
                    , shade: 0.3
                    , content: '/page/xinzeng'
                    , btn: ['提交', '重置'] //只是为了演示
                    , yes: function () {
                        alert("哼。讨厌")
                    }
                    , btn2: function () {
                        layer.closeAll();
                    }
                    , zIndex: layer.zIndex //重点1
                    , success: function (layero) {
                        layer.setTop(layero); //重点2
                    }
                });
            }
        };
    })
</script>





